//
// Created by Administrator on 2023/8/6.
//
#include <iostream>
#include <string>
#include <unordered_set>

using namespace std;

class Solution {
public:
    string greatestLetter(string s) {
        unordered_set<char> set;
        for (auto &x: s) set.insert(x);
        int index = -1;
        for (int i = 0; i < 26; ++i) {
            if (set.count('a' + i) && set.count('A' + i))
                index = i;
        }
        // 返回'A'+index 的大写
        return index == -1 ? "" : string(1, 'A' + index);
    }
};

int main() {
    Solution s;
    cout << s.greatestLetter("lEeTcOdE") << endl;
    return 0;
}
